//package com.example.springapplicationdemo;
//
//import com.example.springapplicationdemo.exception.BusinessException;
//import org.springframework.core.annotation.Order;
//import org.springframework.stereotype.Controller;
//import org.springframework.web.bind.annotation.ControllerAdvice;
//import org.springframework.web.bind.annotation.ExceptionHandler;
//import org.springframework.web.servlet.ModelAndView;
//
//@Order(1)
//@ControllerAdvice(annotations = Controller.class)
//public class BusinessPageControllerAdvice {
//
//    /**
//     * ControllerAdvice中的ExceptionHandler会对ControllerAdvice作用域中的Controller生效
//     * @param e
//     * @return
//     */
//    // 不指定待处理的异常类型，所有UserException的子类型都会被处理
//    @ExceptionHandler
//    public ModelAndView handleExceptionUsePage(BusinessException e){
//        ModelAndView mv =  new ModelAndView("controller_advice_error");
//        mv.addObject("error", e);
//        return mv;
//    }
//}
